package cn;

import java.util.Scanner;

public class Main {
    public static int cut(int[] p,int n){
        if(n==0){
            return 0;
        }
        int q=0;
        for(int i=1;i<=n;i++){
            q=Math.max(q,p[i]+cut(p,n-i));
        }
        return q;
    }

    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        int n= scanner.nextInt();
        int[] arr={0,1,5,8,9,10,17,17,20,24,30};
        int a=cut(arr,n);
        System.out.println(a);
    }

}
